const CURD = require('../compontents/CURD');
const baseTool = require('../common/base-tool');
const crypto = require('crypto');

class RoomData {
    constructor() {
        this.room = '';
    }

    get(msg, roleInfo = '') {
        // 获取用户信息
        return new Promise(resolve => {

            // 获取房间信息
            if (msg.type == 'npc') {
                // 获取NPC信息
                this.room = require(`./${msg.path}/npc/${msg.name}.json`);
            } else if (msg.type == 'exit') {
                // 获取房间信息
                this.room = require(`./${msg.room}.json`);
            } else {
                this.room = {msg: '无房间信息'};
            }
            // console.log(this.room)
            resolve(this.room);
        });
    }

}
module.exports = RoomData;